import request from '@/config/index';
const baseUrl = '/client';
const baseUrl1 = '/crm/data';


/*-------------------------------自定义字段--------------------------------------*/
// 列表-卡片
// export const ApiListCard = (params:any) => {
// 	return request.get({ url: `${baseUrl}/pageView`, params });
// };

// 列表-table
export const ApiList = (params:any) => {
	return request.get({ url: `${baseUrl}/page`, params });
};

// 添加
export const ApiAdd = (data:any) => {
	return request.post({ url: `${baseUrl}/add-submit`, data });
};

// 修改-card
export const ApiUpdate = (data:any) => {
	return request.post({ url: `${baseUrl}/update-submit`, data });
};

// 修改-list
export const ApiUpdateRow = (data:any) => {
	return request.post({ url: `${baseUrl}/update-row`, data });
};

// 删除
export const ApiDelete = (params:any) => {
	return request.get({ url: `${baseUrl}/destroy`, params });
};

// 详情
export const ApiDetail = (params:any) => {
	return request.get({ url: `${baseUrl}/get-info`, params });
};

// 来源
export const ApiSourceList = (params:any) => {
	return request.get({ url: `${baseUrl}/info-enum`, params });
};

// 查询唯一码是否重复
export const ApiCodeOnly = (code:any) => {
	return request.get({ url: `${baseUrl}/check-code?code=${code}` });
};



// ======================(客户)===================

// 数据-查询配置的字段信息
export const columnConfig = (params) => {
	return request.get({ url: `${baseUrl1}/column-config`,params });
};


// 数据-提交数据
export const customerDataSubmit = (data) => {
	return request.post({ url: `${baseUrl1}/data-submit`,data });
};
// 数据-提交数据
export const customerDataUpdate = (data) => {
	return request.post({ url: `${baseUrl1}/data-update`,data });
};


// 数据-查询业务数据
export const customerDataPage = (data) => {
	return request.post({ url: `${baseUrl1}/data-page`,data });
};

// 数据-根据bizId查询字段列名数据
export const columnTitle = (params) => {
	return request.get({ url: `${baseUrl1}/column-title`,params });
};


// 数据-根据bizId查询字段列名数据
export const customerDataInfo = (params) => {
	return request.get({ url: `${baseUrl1}/data-info`,params });
};


// 数动态-分组获取数据的日志信息
export const logList = (params) => {
	return request.get({ url: `/crm/log/list`,params });
};

// 删除数据
export const dataDelete = (params) => {
	return request.get({ url: `/crm/data/data-delete`,params });
};